#pragma once

namespace gp
{
	class ConstantBufferSet
	{
	public:

		void				Create(gk::GpuProgramHandle hGpuProgram);
		void				Release();

		void				Commit(gk::ContextHandle hContext);

		void				SetConstant(gk::GpuProgramConstantHandle hConstant, gk::TextureHandle hTexture);
		void				SetConstant(gk::GpuProgramConstantHandle hConstant, float v);
		void				SetConstant(gk::GpuProgramConstantHandle hConstant, cr::Vec4fRef v);
		void				SetConstant(gk::GpuProgramConstantHandle hConstant, cr::Matrix4fRef v);
		void				SetConstant(gk::GpuProgramConstantHandle hConstant, float* v, cr::size_t num);
		void				SetConstant(gk::GpuProgramConstantHandle hConstant, int v);

	private:

		gk::ConstantBuffer	m_buffers[gk::Constants::MaxConstantTablesPerGpuProgram];
		cr::size_t			m_numBuffers;
	};

	typedef cr::Handle<ConstantBufferSet> ConstantBufferSetHandle;
}